import Taro from "@tarojs/taro";
export function setUserInfo(data) {
  Taro.setStorageSync("user", data);
}

export function getUserInfo() {
  //   const data = Taro.getStorageInfoSync({ key: "user" });
  try {
    var value = Taro.getStorageSync("user");
    if (value) {
      // Do something with return value
      return JSON.parse(value);
    }
  } catch (e) {
    // Do something when catch error
  }
}

export function removeUserInfo(data) {
  try {
    Taro.removeStorageSync("user");
  } catch (e) {
    // Do something when catch error
  }
}
